home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / init.d / mountall.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2012-03-27  |  1.6 KB  |  89 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          mountall
  4. # Required-Start:    checkfs
  5. # Required-Stop: 
  6. # Default-Start:     S
  7. # Default-Stop:
  8. # Short-Description: Mount all filesystems.
  9. # Description:
  10. ### END INIT INFO
  11.  
  12. PATH=/sbin:/bin
  13. . /lib/init/vars.sh
  14.  
  15. . /lib/lsb/init-functions
  16. . /lib/init/mount-functions.sh
  17. . /lib/init/swap-functions.sh
  18.  
  19. # for ntfs-3g to get correct file name encoding
  20. if [ -r /etc/default/locale ]; then
  21.     . /etc/default/locale
  22.     export LANG
  23. fi
  24.  
  25. do_start() {
  26.     #
  27.     # Mount local file systems in /etc/fstab.
  28.     #
  29.     mount_all_local() {
  30.         mount -a -t nonfs,nfs4,smbfs,cifs,ncp,ncpfs,coda,ocfs2,gfs,gfs2 \
  31.         -O no_netdev
  32.     }
  33.     pre_mountall
  34.     if [ "$VERBOSE" = no ]
  35.     then
  36.         log_action_begin_msg "Mounting local filesystems"
  37.         mount_all_local
  38.         log_action_end_msg $?
  39.     else
  40.         log_daemon_msg "Will now mount local filesystems"
  41.         mount_all_local
  42.         log_end_msg $?
  43.     fi
  44.     post_mountall
  45.  
  46.     case "$(uname -s)" in
  47.       *FreeBSD)
  48.         INITCTL=/etc/.initctl
  49.         ;;
  50.       *)
  51.         INITCTL=/dev/initctl
  52.         ;;
  53.     esac
  54.  
  55.     #
  56.     # We might have mounted something over /dev, see if
  57.     # /dev/initctl is there.  Look for /usr/share/sysvinit/update-rc.d
  58.     # to verify that sysvinit (and not upstart) is installed).
  59.     #
  60.     if [ ! -p $INITCTL ] && [ -f /usr/share/sysvinit/update-rc.d ]; then
  61.         rm -f $INITCTL
  62.         mknod -m 600 $INITCTL p
  63.         kill -USR1 1
  64.     fi
  65.  
  66.     # Execute swapon command again, in case we want to swap to
  67.     # a file on a now mounted filesystem.
  68.     swaponagain 'swapfile'
  69. }
  70.  
  71. case "$1" in
  72.   start|"")
  73.     do_start
  74.     ;;
  75.   restart|reload|force-reload)
  76.     echo "Error: argument '$1' not supported" >&2
  77.     exit 3
  78.     ;;
  79.   stop)
  80.     # No-op
  81.     ;;
  82.   *)
  83.     echo "Usage: mountall.sh [start|stop]" >&2
  84.     exit 3
  85.     ;;
  86. esac
  87.  
  88. :
  89.